package com.closer.server.biz.problem.service.impl;

import com.closer.server.biz.submission.dto.SearchRequest;
import com.closer.server.biz.submission.dto.vo.SubmissionVO;
import com.closer.server.biz.problem.validator.SubmissionValidator;
import com.mybatisflex.core.paginate.Page;
import com.mybatisflex.spring.service.impl.ServiceImpl;
import com.closer.server.biz.problem.entity.Submission;
import com.closer.server.mapper.problem.SubmissionMapper;
import com.closer.server.biz.problem.service.SubmissionService;
import org.springframework.stereotype.Service;

/**
 * 提交记录表 服务层实现。
 *
 * @author closer
 */
@Service
public class SubmissionServiceImpl extends ServiceImpl<SubmissionMapper, Submission>  implements SubmissionService{

    public final SubmissionValidator validator;

    public SubmissionServiceImpl(SubmissionValidator validator) {
        this.validator = validator;
    }

    @Override
    public Page<SubmissionVO> search(SearchRequest params) {
        validator.validate(params);
        return this.mapper.search( params);
    }
}
